<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="Dashboard">
  <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
  <title>Dashio - Bootstrap Admin Template</title>
  <%@ include file="/include/link_css.jsp"%>
  <script>
    function forword(url) {
        window.location.replace(url);
    }
  </script>
  
</head>

<body>
  <section id="container">
    <!-- **********************************************************************************************************************************************************
        TOP BAR CONTENT & NOTIFICATIONS
        *********************************************************************************************************************************************************** -->
    <!--header start-->
    <%@ include file="/include/header.jsp"%>
    <!--header end-->
    <!-- **********************************************************************************************************************************************************
        MAIN SIDEBAR MENU
        *********************************************************************************************************************************************************** -->
    <!--sidebar start-->
    <%@ include file="/include/sidebar.jsp"%>
    <!--sidebar end-->
    <!-- **********************************************************************************************************************************************************
        MAIN CONTENT
        *********************************************************************************************************************************************************** -->
    <!--main content start-->
    <section id="main-content">
      <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i>商品信息管理</h3>
        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
          <div class="col-lg-12">
            <div class="form-panel">
              <c:if test="${empty product}">
              <h4 class="mb"><i class="fa fa-angle-right"></i>商品添加</h4>
              </c:if>
              <c:if test="${!empty product}">
                <h4 class="mb"><i class="fa fa-angle-right"></i>商品修改</h4>
              </c:if>

              <form action="${pageContext.request.contextPath }/modify_product.do" class="form-horizontal style-form" method="post">
                <c:if test="${empty product}">
                  <input type="hidden" name="method" value="add">
                </c:if>
                <c:if test="${!empty product}">
                  <input type="hidden" name="method" value="update">
                  <input type="hidden" name="pid" value="${product.pid}">
                </c:if>

                <div class="form-group">
                  <label class="col-sm-2 col-sm-2 control-label">商品名称</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="商品名称" name="pname" value="${product.pname}">
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 col-sm-2 control-label">商品单位</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="商品单位" name="unit" value="${product.unit}">
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 col-sm-2 control-label">商品数量</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="商品数量" name="count" value="${product.count}">
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 col-sm-2 control-label">商品备注</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="商品备注" name="mark" value="${product.mark}">
                  </div>
                </div>

                <button type="submit" class="btn btn-theme">保存</button>
              </form>
            </div>
          </div>
          <!-- col-lg-12-->
        </div>
      </section>
      <!-- /wrapper -->
    </section>
    <!-- /MAIN CONTENT -->
    <!--main content end-->

  <%@ include file="/include/link_js.jsp"%>

</body>

</html>
